<template>
	<view v-if="goodsInfo" class="u-skeleton" style="">
		<!-- <u-navbar :borderBottom="false" back-text=" " :title="title"></u-navbar> -->
		<!-- <u-swiper bg-color="#fff" height="480" :bottomHeight='20' border-radius="0" imgMode="aspectFit" :list="goodsInfo.pic"></u-swiper> -->
		<!-- <u-navbar :is-back="true" back-text=" " :title-color="style.color5" :background="{background:style.color2}" :title-size="30" :title-width="400" title="商品详情"></u-navbar> -->
		<view class="Collection">
			<swiper class="swipers u-skeleton-fillet" circular :indicator-dots="true" :autoplay="true" :interval="2000">
				<swiper-item v-for="(item,index) in goodsInfo.pic" :key="index" class="swiper_item">
					<view v-if="index==0" class="" style="width: 100%;height: 100%; ;">
						<kuang-big v-if="goodsInfo.template_id" :src="item" :item="chagne_item(goodsInfo)"></kuang-big>
						<u-image v-else class="img_banner" :src="item" width="100%" height="800rpx"
							mode="heightFix"></u-image>
					</view>
					<u-image v-if="index!=0" class="img_banner" :src="item" width="100%" height="800rpx"
						mode="heightFix"></u-image>

				</swiper-item>
			</swiper>
			<!-- <view  class="Collection_box">
				<u-icon :name="goodsInfo.is_collection?'heart-fill':'heart'" color="#fff" size="40"></u-icon>
			</view> -->
			<image @click="navBack" class="back back_left" src="../../static/vip/icon_27.png" mode=""></image>
			<image @click="share" class="back back_right" src="../../static/vip/icon_28.png" mode=""></image>

		</view>
		<!-- 商品价格/倒计时 -->
		<view class="shop_price_bgc">
			<view class="shop_price_bgc_left">
				<view class="" v-if="seckill_id">
					<view class="" v-if="goodsInfo.seckill.start_time<0" :style="{background:style.color1}"
						style="margin-left: 0;">
						<span style="font-size: 24rpx; font-weight: 500; color: #fff; margin-right: 8rpx;">活动将在</span>
						<u-count-down @change="star_time_change" color="#fff" bg-color="rgba(0,0,0,0)"
							separator-color="#fff" font-size="26" :show-hours="true"
							:timestamp="star_time"></u-count-down>
						<span style="font-size: 24rpx; font-weight: 500; color: #fff; margin-left: 8rpx;">秒后开始</span>
					</view>
					<view class="" v-if="goodsInfo.seckill.end_time<0 && goodsInfo.seckill.start_time>0"
						style="margin-left: 0rpx;">
						<span style="font-size: 24rpx; font-weight: 500; color: #fff; margin-right: 8rpx;">活动将在</span>
						<u-count-down @change="end_time_change" color="#fff" bg-color="rgba(0,0,0,0)"
							separator-color="#fff" font-size="26" :show-hours="true"
							:timestamp="end_time"></u-count-down>
						<span style="font-size: 24rpx; font-weight: 500; color: #fff; margin-left: 8rpx;">秒后结束</span>
					</view>
					<view class="" v-if="goodsInfo.seckill.end_time>0 && goodsInfo.seckill.start_time>0"
						style="font-size: 24rpx; font-weight: 500; color: #fff;margin-left: 0rpx;">
						活动已结束
					</view>
				</view>
				<view class="price_left">

					<view v-if="(!seckill_id)" class="shop_price " :style="{color:style.color3}">
						<span class="price_left_1">¥</span>
						<span class="price_left_2">{{goodsInfo.price}}</span>
						<span class="price_left_3">RMB</span>
					</view>
					<view v-if="!(!seckill_id)" class="shop_price " :style="{color:style.color3}">
						<span class="price_left_1">¥</span>
						<span class="price_left_2">{{chooseSkuItem.seckill_price}}</span>
						<span class="price_left_3">RMB</span>
					</view>
					<!-- <view v-if="(!seckill_id)" class="shop_price_rmb " :style="{color:style.color3}">
						约 {{goodsInfo.cny_price}} RMB
					</view>
					<view v-if="!(!seckill_id)" class="shop_price_rmb ">
						约 {{chooseSkuItem.seckill_cny_price}} RMB
					</view> -->
				</view>
			</view>
			<view class="shop_price_bgc_right">
				限时特惠
			</view>
		</view>
		<!-- 商品信息 -->
		<view class="shop_connect_info">
			<view class="shop_connect_info_box">
				<!-- <span class="shop_name">
					<span v-if="ite.name=='预售'" v-for="(ite,ind) in goodsInfo.label" :key="ind" class="biaaQAian">
						{{ite.name}}
					</span>

					{{goodsInfo.name}}
				</span> -->
				<view class="" style="display: flex; justify-content: space-between;">
					<span  class="shop_name" style="line-height: 30rpx;">
						<span  v-if="ite.name=='预售'" v-for="(ite,ind) in goodsInfo.label" :key="ind" class="biaaQAian">
							{{ite.name}}
						</span>
						{{goodsInfo.name}}
					</span>
					<image @click="copyText(goodsInfo.name)" src="/static/icon/copy.png" style="width: 24rpx; height: 24rpx;margin-top: 6rpx;" mode=""></image>
				</view>
				<view class="shop_connect">
					{{goodsInfo.promotion?goodsInfo.promotion:'暂无描述'}}
				</view>
				<view class="biapQina_all u-skeleton-rect">
					<span v-if="ite.name !='预售'" v-for="(ite,ind) in goodsInfo.label" :key="ind" class="biaaQAian">
						{{ite.name}}
					</span>

				</view>
				<view class="xiao_box">
					<span>销量:{{goodsInfo.sales_num}}</span>
					<span>点击量:{{goodsInfo.click_num}}</span>
				</view>
			</view>
		</view>
		<!-- 查看会员 -->
		<view class="vip" style="">
			<view class="vip_box">
				<view class="vip_box_left">
					<image style="width: 48rpx; height: 28rpx;" src="../../static/vip/icon_25.png" mode=""></image>
					<span class="vip_title">开通会员，此单购物最高95折</span>
				</view>
				<view @click="nav_to('/pages/self/vip')" class="vip_box_btn">
					去了解
					<u-icon style="margin-left: 8rpx;" name="arrow-right" color="#dac5a5" size="24"></u-icon>
				</view>
			</view>
		</view>
		<!-- 优惠劵/快递 -->
		<view class="coupon_box">
			<view class="coupon_box_item">
				<view @click="openCoupon()" v-if="couponList.length>0" class="coupon_list_1 position_1">
					<span>领劵</span>
					<scroll-view :scroll-x="true" class="coupon_list_2">
						<view v-for="(item , index) in couponList" :key="index" style="display: inline-block;" class="">
							<view class="juan_item">
								<view>劵</view>
								<view class="uni-ellipsis" style="text-align: left; width: 100rpx;text-align: center;">
									{{item.title}}
								</view>
							</view>
						</view>
					</scroll-view>
					<view class="meng_option_box">

					</view>
					<u-icon style="margin-top: 10rpx;" name="arrow-right" color="#DDD" size="28"></u-icon>
				</view>
				<view class="coupon_list_1" style="border-bottom: none;">
					<span>快递</span>
					<view v-if="goodsInfo.full_reduction!==null" class="baoyou">
						<span class="biaaQAian">包邮</span>
						{{goodsInfo.full_reduction?goodsInfo.full_reduction.name:''}}
					</view>
					<u-icon style="margin-top: 10rpx;" name="arrow-right" color="#DDD" size="28"></u-icon>
				</view>

			</view>
			<view class="pin_box">
				<view class="pin_box_item">
					<image style="width: 28rpx; height: 28rpx;margin-right: 8rpx;" src="../../static/vip/icon_21.png"
						mode=""></image>
					<span>自营商品</span>
				</view>
				<view class="pin_box_item">
					<image style="width: 28rpx; height: 28rpx;margin-right: 8rpx;" src="../../static/vip/icon_22.png"
						mode=""></image>
					<span>日本直邮</span>
				</view>
				<view class="pin_box_item">
					<image style="width: 28rpx; height: 28rpx;margin-right: 8rpx;" src="../../static/vip/icon_23.png"
						mode=""></image>
					<span>正品保证</span>
				</view>
				<view class="pin_box_item">
					<image style="width: 28rpx; height: 28rpx;margin-right: 8rpx;" src="../../static/vip/icon_24.png"
						mode=""></image>
					<span>售后无忧</span>
				</view>
			</view>
		</view>


		<!-- 商品详情 -->
		<view class="" style="font-size: 26rpx; line-height: 40rpx; padding:0 24rpx;">
			{{goodsInfo.content_desc}}
		</view>
		<!-- 商品图片详情 -->
		<image v-for="(item,index) in goodsInfo.content_pic" :key="index" :src="item" mode="widthFix"
			style="width: 100%;"></image>
		<!-- 支付收藏按钮 -->
		<view class="" style="width: 100%; height: 200rpx;">

		</view>
		<view v-if="btn_show" class="buy_btn_box">
			<view class="buy_btn_box_left">
				<!-- <view class="icon_box" @click="back_home">
					<u-icon name="home" color="#858585" size="32"></u-icon>
					首页
				</view> -->

				<view @click="navTo('/pages/cart/cart')" class="icon_box">
					<!-- <image class="icon_box_img" style="" src="../../static/tabber_icon/cart1.png" mode=""></image> -->
					<u-icon class="icon_box_img" name="shopping-cart" color="#404449" size="32"></u-icon>
					购物车
				</view>
				<view class="icon_box">
					<!-- <image class="icon_box_img" style="" src="../../static/vip/icon_32.png" mode=""></image> -->
					<u-icon @click="UserCollection_add(goodsInfo.id)" class="icon_box_img"
						:name="goodsInfo.is_collection?'star-fill':'star'" color="#404449" size="32"></u-icon>
					{{goodsInfo.is_collection?'取消收藏':'收藏'}}
				</view>
			</view>
			<view class="buy_btn_box_right">
				<view @click="openPop(0)" v-if="(!seckill_id)" class="buy_now by_tocard">
					加入购物车
				</view>
				<view @click="openPop(1)" class="buy_now" :style="{background:style.color1}">
					立即购买
				</view>
			</view>
		</view>
		<u-popup v-model="pop_show" border-radius="20" style="z-index:999;" mode="bottom">
			<view class="sku_box_pop">
				<view class="pop_box">
					<u-image width="300rpx" height="300rpx" border-radius="20" mode="widthFix"
						:src="$image_url(chooseSkuItem.pic?chooseSkuItem.pic:this.goodsInfo.pic[0])"></u-image>
					<view class="pop_box_right">
						<view class="right_title">

							<view v-if="(!seckill_id)" class="right_title_pic uni-ellipsis"
								:style="{color:style.color3}">
								RMB ¥ {{chooseSkuItem.price}}
							</view>
							<view v-if="!(!seckill_id)" class="right_title_pic uni-ellipsis"
								:style="{color:style.color3}">
								RMB ¥ {{chooseSkuItem.seckill_price}}
							</view>

							<view v-if="goodsInfo.stock_status==0 && (!seckill_id)" style="margin-top: 32rpx;"
								class="right_title_top uni-ellipsis">
								库存：{{chooseSkuItem.stock}}
							</view>
							<view v-if="goodsInfo.stock_status==0 && !(!seckill_id)" style="margin-top: 32rpx;"
								class="right_title_top uni-ellipsis">
								库存：{{chooseSkuItem.dec_stock}}
							</view>
							<view v-if="(!seckill_id)" class="right_title_top uni-ellipsis" style="margin-top: 32rpx;">
								商品限购：{{goodsInfo.limited_edition>0?goodsInfo.limited_edition+'/人':'暂无限购'}}
							</view>
							<view v-if="!(!seckill_id)" class="right_title_top uni-ellipsis" style="margin-top: 32rpx;">
								商品限购：{{chooseSkuItem.quota>0?chooseSkuItem.quota+'/单':'暂无限购'}}
							</view>
							<view style="margin-top: 32rpx;" class="right_title_top uni-ellipsis">
								已选择：{{chooseSkuItem.sku}}
							</view>
						</view>
						<view v-if="(!seckill_id)" class="addNumber">
							<span>数量:</span>
							<u-number-box v-if="chooseSkuItem.stock>0" :min="1"
								:max="goodsInfo.limited_edition>chooseSkuItem.stock?chooseSkuItem.stock:goodsInfo.limited_edition>0?goodsInfo.limited_edition:chooseSkuItem.stock"
								v-model="sku_num" @change="valChange"></u-number-box>
							<view v-else style="color: #ccc; font-size: 20rpx;">
								暂无库存
							</view>
						</view>
						<view v-if="!(!seckill_id)" class="addNumber">
							<span>数量:</span>
							<u-number-box v-if="chooseSkuItem.dec_stock>0" :min="1"
								:max="chooseSkuItem.dec_stock>chooseSkuItem.quota?chooseSkuItem.quota:chooseSkuItem.dec_stock"
								v-model="sku_num" @change="valChange"></u-number-box>
							<view v-else style="color: #ccc; font-size: 20rpx;">
								暂无库存
							</view>
						</view>

					</view>
				</view>
				<view class="sku_list_box">
					<view v-for="(item,index) in goodsInfo.spec" :key="index" class="sku_list_box_item">
						<view class="sku_list_box_item_title">
							{{item.name}}
						</view>
						<view class="sku_list_box_item_btn">
							<view @click="chooseSku(index , ind)" :class="ite.isChoose?'sub_choose':''"
								:style="ite.isChoose?{border:`1rpx solid ${style.color4}`,'background':`${style.color6}` , 'color':`${style.color7}`}:{}"
								v-for="(ite,ind) in item.item" :key="ind" class="sku_item">
								{{ite.text}}
							</view>
						</view>
					</view>
				</view>
				<view v-if="(!seckill_id)" class="pay_sub">
					<view v-if="chooseSkuItem.stock>0" class="submit_btn" :style="{background:style.color1}"
						@click="wxPay">
						{{isbuy?'立即购买':'加入购物车'}}
					</view>
					<view v-else class="submit_btn" style="background-color: #ccc; color: #777;">
						暂无库存
					</view>
				</view>
				<view v-if="!(!seckill_id)" class="pay_sub">
					<view v-if="chooseSkuItem.dec_stock>0" :style="{background:style.color1}" class="submit_btn"
						@click="wxPay">
						{{isbuy?'立即购买':'加入购物车'}}
					</view>
					<view v-else class="submit_btn" style="background-color: #ccc; color: #777;">
						暂无库存
					</view>
				</view>

			</view>
		</u-popup>
		<!--引用组件-->
		<u-skeleton :loading="loading" :animation="true" bgColor="#FFF"></u-skeleton>

		<!-- 优惠劵弹出 -->
		<liu-popup type="center" ref="center1" bgColor="none" @close="gogngaoClose">
			<view class="couponBox2">
				<image style="width: 100%;" src="../../static/inde_png/index_icon_14.png" mode="widthFix"></image>
				<view class="couponBox2_box">
					<image class="tu-png" src="../../static/inde_png/index_icon_15.png" mode=""></image>
					<scroll-view :scroll-y="true" class="coupon_list">
						<view v-for="(item,index) in couponList" :key="index" class="coupon_list_item">
							<view class="coupon_list_item_left">
								¥{{ Math.trunc(item.money) }}
							</view>
							<view class="coupon_list_item_right">
								<veiw class="right_title1 uni-ellipsis">{{item.title}}</veiw>
								<veiw class="right_title2">{{item.remark}}</veiw>
							</view>
						</view>
					</scroll-view>
					<view @click="take" class="coupon_btn">
						立即领取
					</view>
				</view>
			</view>
		</liu-popup>
	</view>
</template>

<script>
	import kuangBig from '@/componts/index_comp/kuang_big.vue';
	export default {
		components: {
			kuangBig
		},
		data() {
			return {
				style: {},
				btn_show: true,
				end_time: '',
				star_time: '',
				color: '#fff',
				loading: true,
				sku_num: 1,
				pop_show: false,
				pop_show2: false,
				isbuy: 0, //立即购买
				id: '',
				seckill_id: '', //抢购活动id
				title: '商品详情',
				goodsInfo: null,
				chooseSkuItem: {}, // 当前选中的规格项
				comment_info: [],
				couponList: [], //优惠劵列表
				have_comment: false,
				user_info: {},
				token: '',
				other_id: null, // 分销商ID
				seckill_goods_id: null, //
			}
		},
		onLoad(e) {
			this.id = e.id
			if (e.uid) {
				this.other_id = e.uid
			}
			if (e.seckill_id) {
				this.seckill_id = e.seckill_id
				this.seckill_goods_id = e.seckill_goods_id
			}
			// #ifdef MP-WEIXIN
			uni.showShareMenu({
				// https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share.html
				withShareTicket: true,
				menus: ['shareAppMessage', 'shareTimeline'] //开启转发好友和转发朋友圈按钮
			});
			// #endif

		},
		// 开启小程序原生右上角分享按钮

		onShow() {
			var style = uni.getStorageSync('style')
			style = JSON.parse(style)
			this.style = style
			this.getInfo()
			this.token = uni.getStorageSync('token')
			if (this.token) {
				this.user_info = uni.getStorageSync('user_info')
			}
		},
		methods: {
			navBack() {
				const pages = getCurrentPages();
				const currentPage = pages[pages.length - 1];
				if (pages.length > 1) {
					uni.navigateBack({
						delta: 1,
						success: () => console.log('返回成功'),
						fail: err => console.error('返回失败:', err)
					});
				} else {
					uni.switchTab({
						url: '/pages/index/index'
					});
				}
			},
			chagne_item(item) {
				console.log(item)
				var cc = JSON.parse(JSON.stringify(item))
				if (cc.template) {
					cc.template = JSON.parse(cc.template)
				}
				// if(cc.template_style){
				// 	cc.template = JSON.parse(cc.template)
				// }
				return cc
			},
			star_time_change(e) {
				this.star_time = e
				if (this.star_time <= 0) {
					this.goodsInfo.seckill.start_time = 1
					this.btn_show = true
				}

			},
			end_time_change(e) {
				this.end_time = e
				if (e <= 0) {
					this.btn_show = false
					this.goodsInfo.seckill.end_time = 1

				}
			},
			copyText(text) {
				uni.setClipboardData({
					data: text, // 要复制的文本
					success: () => {
						uni.showToast({
							title: '复制成功',
							icon: 'none'
						});
					},
					fail: (err) => {
						uni.showToast({
							title: '复制失败',
							icon: 'none'
						});
					}
				});
			},
			take() {
				this.couponList.forEach((item, index) => {
					this.$wqzApi.coupon_record({
						coupon_id: item.id
					}).then(res => {
						if (res.code == 200) {
							uni.showToast({
								title: '领取成功',
								icon: 'success'
							})
							this.$refs['center1'].close();
						}
						// this.$refs.paging.complete(res.data.list);
					}).catch(err => {
						// this.$refs.paging.complete(false);
						uni.showToast({
							title: '请重试',
							icon: 'none'
						})
					})
				})

			},
			gogngaoClose() {
				this.$refs['center'].close();
			},
			openCoupon() {
				this.$wqzApi.UserCouponPopup({}).then(res => {
					if (uni.getStorageSync('token') && res.data.length > 0) {
						this.couponList = res.data
						this.$refs['center1'].open();

					}
				})
			},
			closeTypeChoose1(ref1) {
				this.$refs[ref1].close()
			},
			back_home() {
				uni.switchTab({
					url: '/pages/index/index'
				})
			},
			share() {
				var url = window.location.href;
				if (this.token) {
					if (this.user_info.dealer_level == 1 || this.user_info.dealer_level == 2) {
						url = `${url}&uid=${this.user_info.id}`
					}
				}
				uni.setClipboardData({
					data: url,
					success: function() {
						uni.showToast({
							title: '链接复制成功',
							icon: 'success'
						})
					}
				});
			},
			previewImage(index, arr) {
				uni.previewImage({
					current: index, // 当前显示图片索引
					urls: arr // 需要预览的图片http链接列表
				});
			},

			// 商品收藏
			UserCollection_add(id) {
				var title = ''
				if (!this.goodsInfo.is_collection) {
					var data = {
						gid: id
					}
					title = '收藏成功'
					this.$wqzApi.UserCollection_add(data).then(res => {
						this.goodsInfo.is_collection = 1
						uni.showToast({
							title: title,
							icon: 'none'
						})
					})
				} else {
					var data = {
						id: id
					}
					title = '取消收藏'
					this.$wqzApi.UserCollection_del(data).then(res => {
						this.goodsInfo.is_collection = 0
						uni.showToast({
							title: title,
							icon: 'none'
						})
					})
				}
			},
			navTo(url) {
				uni.switchTab({
					url: url
				})
			},
			nav_to(url) {
				uni.navigateTo({
					url: url
				})
			},
			// 规格数量改变
			valChange() {

			},
			// 选择sku
			chooseSku(index, ind) {
				this.value = 1
				this.goodsInfo.spec[index].item.forEach((item, index1) => {
					this.goodsInfo.spec[index].item[index1].isChoose = false
				})
				this.goodsInfo.spec[index].item[ind].isChoose = true
				this.getSku()
			},
			// 匹配sku机制
			getSku() {
				return new Promise((resolve, reject) => {
					var chooseArr = []
					var sku_tree = JSON.parse(JSON.stringify(this.goodsInfo.spec))
					sku_tree.forEach((item, index) => {
						item.item.forEach((ite, ind) => {
							if (ite.isChoose) {
								chooseArr.push(ite.text)
							}
						})
					})
					var skuname = chooseArr.join(',')
					this.goodsInfo.spec_list.forEach((item, index) => {
						if (item.sku == skuname) {
							item.pic = this.$filterImg(item.pic)
							this.chooseSkuItem = item
							this.sku_num = 1
						}
					})

				})
			},
			getInfo() {
				var data = {
					id: this.id,
					seckill_id: this.seckill_id
				}
				this.$wqzApi.index_goods_detail(data).then(res => {
					res.data.pic = res.data.pic.split(',')
					res.data.spec.forEach((item, index) => {
						res.data.spec[index].item = JSON.parse(item.item)
						var arr = []
						res.data.spec[index].item.forEach((ite, ind) => {
							arr.push({
								isChoose: ind == 0 ? true : false,
								text: ite
							})
						})
						res.data.spec[index].item = arr

					})
					if (res.data.comment_count.all_comment == 0) {
						this.have_comment = false
					} else {
						res.data.goods_comment.pic = res.data.goods_comment.pic.split(',')
						this.have_comment = true
					}
					if (res.data.content_pic) {
						res.data.content_pic = res.data.content_pic.split(',')
					}
					this.goodsInfo = res.data
					if (this.goodsInfo.content) {
						this.goodsInfo.content = this.$filterImg(this.goodsInfo.content)
					}

					this.getSku()
					this.loading = false
					var token = uni.getStorageSync('token')
					if (token) {
						this.openCoupon()
					}
					if (this.seckill_id) {
						if (this.goodsInfo.seckill.start_time > 0 && this.goodsInfo.seckill.end_time > 0) {
							uni.showToast({
								title: '活动已结束',
								icon: 'none'
							})
							this.btn_show = false
						} else {
							this.star_time = Math.abs(this.goodsInfo.seckill.start_time)
							this.end_time = Math.abs(this.goodsInfo.seckill.end_time)
							if (this.goodsInfo.seckill.start_time < 0) {
								this.btn_show = false
								uni.showToast({
									title: '活动暂未开始',
									icon: 'none'
								})
								return
							}

							this.btn_show = true
						}

					}
				}).catch(err => {
					uni.hideLoading()
					this.loading = false
				})
			},
			openPop(e) {
				this.value = 1
				this.isbuy = e
				this.pop_show = true
			},
			// 微信支付
			wxPay() {
				var data = {
					id: this.goodsInfo.id,
					num: this.value,
					goods_spec_extend_id: this.chooseSkuItem.id
				}
				var token = uni.getStorageSync('token')
				if (!token) {
					uni.setStorageSync('isModule', true)
					uni.showModal({
						title: '登录',
						content: '登录后可使用完整功能',
						cancelText: "取消", // 取消按钮的文字  
						confirmText: "确认", // 确认按钮的文字  
						showCancel: true, // 是否显示取消按钮，默认为 true
						success: (res) => {
							uni.setStorageSync('isModule', false)
							if (res.confirm) {
								uni.navigateTo({
									url: '/pages/login/login'
								})
							} else {
								uni.switchTab({
									url: '/pages/index/index'
								})
							}
						}
					})
					return
				}
				var that = this
				var data = {
					"goods_id": this.goodsInfo.id,
					"goods_spec_extend_id": this.chooseSkuItem.id,
					"goods_name": this.goodsInfo.name, //商品名
					"sku_name": this.chooseSkuItem.sku, //规格名
					"pic": this.$image_url(this.chooseSkuItem.pic ? this.chooseSkuItem.pic : this.goodsInfo.pic[
						0]), //图片
					"num": this.sku_num //数量
				}
				if (this.isbuy) {
					this.pop_show = false
					var goodInfo = {
						sku_id: this.chooseSkuItem.id,
						gid: this.chooseSkuItem.gid,
						sku_num: this.sku_num
					}
					if (this.other_id) {
						goodInfo.uid = this.other_id
					}
					goodInfo = JSON.stringify(goodInfo)
					setTimeout(() => {
						var url = ''
						if (this.seckill_id) {
							url =
								`/pages/shop_info/order_pay_seckill?Info=${goodInfo}&seckill_id=${this.seckill_id}&seckill_goods_id=${this.seckill_goods_id}`
						} else {
							url = `/pages/shop_info/order_pay?Info=${goodInfo}`
						}
						uni.navigateTo({
							url
						})
					}, 150)
					return
				} else {
					this.$gugoApi.GoodsCart_add(data).then(res => {
						uni.showToast({
							title: '添加成功',
							icon: 'none',
							position: 'bottom'
						})
						this.pop_show = false
					})
				}
			},
		},

	}
</script>

<style lang="scss" scoped>
	@import url(./index.scss);
	@import url(./index_index.scss);
</style>